import { Meta, ArgsTable, Canvas, Story, Markdown } from '@storybook/addon-docs';
import { Alert } from '@zendeskgarden/react-notifications';
import { AlertStory } from './stories/AlertStory';
import README from '../README.md';

<Meta
  title="Packages/Notifications/Alert"
  component={Alert}
  subcomponents={{
    'Alert.Close': Alert.Close,
    'Alert.Paragraph': Alert.Paragraph,
    'Alert.Title': Alert.Title
  }}
/>

# API

<ArgsTable />

# Demo

<Canvas>
  <Story
    name="Alert"
    args={{
      children: 'Text',
      type: 'info',
      title: 'Title',
      hasClose: true,
      hasParagraph: false,
      'aria-label': 'Close'
    }}
    argTypes={{
      title: { name: 'children', table: { category: 'Alert.Title' } },
      isRegular: { control: { type: 'boolean' }, table: { category: 'Alert.Title' } },
      hasClose: { name: 'Alert.Close', table: { category: 'Story' } },
      hasParagraph: { name: 'Alert.Paragraph', table: { category: 'Story' } },
      'aria-label': { table: { category: 'Alert.Close' } }
    }}
    parameters={{
      design: {
        allowFullscreen: true,
        type: 'figma',
        url: 'https://www.figma.com/file/6g87L4FdKZTA3knt3Rsfdx/Garden?node-id=103%3A25292'
      }
    }}
  >
    {args => <AlertStory {...args} />}
  </Story>
</Canvas>

<Markdown>{README}</Markdown>
